using System;
using System.Collections.Generic;
using System.Text;

namespace Zsa.Emulation.Memory
{
    /// <summary>
    /// Contains a memory item an the blocks it handles.
    /// </summary>
    public class MemoryItem
    {
        #region Fields
        /// <summary>
        /// The memory.
        /// </summary>
        private IMemoryStream _Memory;

        /// <summary>
        /// The memory blocks.
        /// </summary>
        private MemoryBlock[] _MemoryBlocks;
        #endregion Fields

        #region Constructor
        /// <summary>
        /// Initializes a new instance of the <see cref="T:MemoryItem"/> class.
        /// </summary>
        /// <param name="memory">The memory.</param>
        /// <param name="blocks">The blocks.</param>
        public MemoryItem(IMemoryStream memory,
            params MemoryBlock[] blocks)
        {
            _Memory = memory;
            _MemoryBlocks = blocks;
        }

        #endregion Constructor

        #region Properties
        /// <summary>
        /// Gets the blocks.
        /// </summary>
        /// <value>The blocks.</value>
        public MemoryBlock[] Blocks
        {
            get
            {
                return _MemoryBlocks;
            }
        }

        /// <summary>
        /// Gets the memory.
        /// </summary>
        /// <value>The memory.</value>
        public IMemoryStream Memory
        {
            get
            {
                return _Memory;
            }
        }
        #endregion Properties
    }
}
